package com.yuandian.management.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuandian.api.customer_perception.po.BusinessAnalysisParams;
import com.yuandian.api.customer_perception.vo.BusinessStepAnalysisVo;
import com.yuandian.api.management.entity.ConfStep;
import com.yuandian.api.management.vo.OptionVo;
import com.yuandian.bpm.common.data.datascope.BpmBaseMapper;
import com.yuandian.management.dto.ConfStepDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 步骤配置表-Mapper接口
 * @author zfsn
 * @date 2023-3-14
 */
@Mapper
public interface ConfStepMapper extends BpmBaseMapper<ConfStep> {

	/**
	 * 通过业务编码删除步骤
	 * @param businessCodes
	 */
    Integer removeStepByBusinessCodes(@Param("businessCodes") List<String> businessCodes);



	/**
	 * 分页查询
	 *
	 * @param confStep 筛选条件
	 * @return 通用返回对象
	 */
    Page<ConfStep> listPage(Page<ConfStep> confStepPage, @Param("params") ConfStep confStep);


	/**
	 * 查询业务步骤类型
	 *
	 * @return 通用返回对象
	 */
    List<Map<String, String>> queryStepTypeByBusinessCode();

	/**
	 * 查询业务步骤类型
	 * @return
	 */
	List<ConfStepDTO> getStepTypeAndBusinessCode();

	/**
	 * 查询步骤
	 *
	 * @param confStep
	 * @return 通用返回对象
	 */
	List<ConfStep> getStepBySystemIdAndStepCode(@Param("params") ConfStep confStep);

	/**
	 * 查询共用步骤的步骤编码和步骤名称
	 * @return 通用返回对象
	 */
	List<OptionVo> queryPublicStepOptions();

	/**
	 * 查询系统id
	 * @return 通用返回对象
	 */
	List<String> querySystemIdByStepCode(@Param("stepCodes") List<String> stepCodes);

    List<ConfStep> getStepByBusinessCodes(@Param("params") ConfStep confStep);

	/**
	 * 查询同一系统共用步骤的业务
	 *
	 * @param stepCode 步骤编码
	 * @param systemId
	 * @param stepId
	 * @return 通用返回对象
	 */
    List<String> getShareBusiness(@Param("stepCode") String stepCode, @Param("systemId") Integer systemId, @Param("stepId") Integer stepId);

	/**
	 * 根据业务编码查询对应业务步骤信息
	 * @param params
	 * @return
	 */
	List<BusinessStepAnalysisVo> selectStepsByBusicessCode(@Param("params") BusinessAnalysisParams params);
}
